<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-common-lib.asp"-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EOC监控系统</title>
<!--#include file="lib/plugins.asp"-->
<style type="text/css">
  .ui-datepicker table {
    border: 0;
  }
  .ui-autocomplete-loading { 
    background: white url('images/ui-anim_basic_16x16.gif') left center no-repeat; 
  }
  .ui-autocomplete,.ui-menu-item .ui-corner-all {
      border-radius: 0;
  }
  thead th{
    text-align:center;
    background:#e0e0e0;
  }
  tbody th[scope="row"],tbody th.sub{
    text-align:center;
  }
  input,select{
    border:1px solid #888888;
  }
  input:hover,input:active,select:hover,select:active{
    border:1px solid #aa6666
  }
  input[type=text]{
    padding:2px;
    margin:1px 0;
  }
  #pagebar{
    float:right;
  }
  #search_bar{
    border-width:1px 0;
  }
  #search_bar td{
    padding:1px;
    border-width:0;
  }
  #search_bar tr:hover td{
    background:#fff;
  }
  .bt_button{
    cursor: pointer;
    overflow: visible;
    width: auto;
    background: url("lib/yaml/screen/images/button_gray.png") repeat-x scroll left top #454545;
    border-color: #DDDDDD #444444 #444444 #DDDDDD;
    border-style: solid;
    border-width: 1px;
    color: #000000;
    padding: 5px 1em;	
  }
  .bt_button:hover,.bt_button:active,.bt_button:focus{
    background: none repeat-x scroll left top #555555;
    border-color: #444444 #DDDDDD #DDDDDD #444444;
    color: #ffffff;
  }
  #page_go,#print_search,.bt_act{
    padding:0;
  }
  .chk{
    background-color:#d0d0d0;
  }
  #diaglog_print{
    display:none;
  }
  #lb_search{
    width:5em;
  }
  #bts_search{
    width:11.9em;
    text-align:right;
  }
  #adv_search{
    display:none;
  }
  
/* Tag cloud */
  
    #tags {  
      text-align:center; 
      padding:10px 0;  
      margin:5px 0;
      overflow:auto; 
    }  
    #tags ul { margin:0; padding:0; }  
    #tags ul li {  
      list-style-type:none; float:left; margin:-1px 10px; 
    }  
    #tags ul li a { text-decoration:none;  line-height:1.1em;}  
    #tags ul li a:hover { text-decoration:none; border:1px solid #aa6666}  	
/* // Tag cloud */

/* select class */

    .sel{
      color:red;
    }
    .unsel{
      color:black;
    }
  
/* // select class */


</style>

<script type="text/javascript">
  $(function() {
    $.ajaxSetup ({
      cache: false, //关闭AJAX相应的缓存
      beforeSend:function() {
        $("#search_bar .ui-widget").addClass( "ui-autocomplete-loading" );
        $("#bt_search").attr("disabled",true);
      },
      complete:function() {
        $("#search_bar .ui-widget").removeClass( "ui-autocomplete-loading" );
        $("#bt_search").attr("disabled",false);
      }
    });

    $(".datepicker").datepicker();
    $( "#diaglog_print" ).dialog({
      autoOpen: false,
      width:280,
      modal: true,
      //position: 'center',
      buttons: {
        "导出": function() {
          window.open('search_print.asp?export=xls&'+$("#fm_search").serialize()+'&'+$("#fm_print").serialize(), '_blank', 'height=768px, width=1024px, scrollbars=yes, resizable=yes');
        },
        "打印": function() {
          window.open('search_print.asp?'+$("#fm_search").serialize()+'&'+$("#fm_print").serialize(), '_blank', 'height=768px, width=1024px, scrollbars=yes, resizable=yes');
        },
        "取消": function() {
          $(this).dialog( "close" );
        }

      }

    });
    $("#print_search").live('click',function(){
      $( "#diaglog_print" ).dialog("open");
    });
    var p=1;
    function vi(p){
      $.get("search_main.asp?page="+p+"&"+$("#fm_search").serialize(),function(data){	//用ajax的get方式提交
        $("#search_main").html(data);

        $("#pagebar a").click(function(e){	//对分页栏中的a元素进行操作
          e.preventDefault();	//阻止a的原先事件
          vi($(this).attr("id"));	//根据获取的页码值调用显示页面函数
        });
        $("#page_go").click(function(e){	//对分页栏中的input元素进行操作
          e.preventDefault();
          if (isNaN($("#page_val").val())||$.trim($("#page_val").val())==""){	//判断输入的是否是数字
            alert("输入的页码错误，请输入正确页码！");
            $("#page_val").select();
            return false;	//页码值不是数字则退出；
          }
          vi($("#page_val").val());
        });
        var chk=$(".checkid");
        $("#checkall").click(function(){
          chk.prop("checked",$(this).prop("checked"));	//根据全选的checkbox状态来填充单个checkbox状态
          $(this).prop("checked") ? chk.closest("tr").addClass("chk") : chk.closest("tr").removeClass("chk")	//判断是否全部选中，选中则增加chk样式，没选中则删除chk样式，不能用toggleClass方法，由于下面单个checkbox会改变全选的checkbox状态
        });
        chk.click(function(){
          if(!$(this).prop("checked")) $("#checkall").prop("checked",false);	//如果当前checkbox状态为未选中则全选的checkbox也设置为未选中
          $(this).closest("tr").toggleClass("chk");	//单个切换当前checkbox存在的tr的chk样式
        });
        
        $(".bt_act").click(function(){
          $chks=$("#search_main input:checkbox.checkid:checked");
          if(confirm("要对这 "+$chks.length+" 条记录做"+$(this).val()+"操作吗？")){
            var aChk=new Array();
            $chks.each(function(){
              aChk.push($(this).val());
            });
            $.post("batch.asp",{chks:aChk.join(),act:$(this).val()},function(data){
              if(data.bStatus){
                vi($("#page_val").val());
              }else{
                alert(data.sInfo);
              }
            },"json");
          }
        });
        
      });

    }
    
    $("#cd_status").change(function(){
      if($(this).val()==3){
        $("#ytksrq").removeAttr("disabled");
        $("#ytjsrq").removeAttr("disabled");
      }else{
        $("#ytksrq").attr("disabled",true).val("");
        $("#ytjsrq").attr("disabled",true).val("");
      }
    });
    $("#bt_search").click(function(){
      var start_time = new Date().getTime();
      vi(p);
      var end_time = new Date().getTime();
      $("#show_runtime").html(end_time-start_time);
    });
    $("#show_adv").click(function(){
      $("#adv_search").toggle();
    });
    
    //搜索条选择框筛选高亮显示
    $("#search_bar select option").click(function(){
      if($(this).index()>0){
        $(this).removeClass("unsel")
          .siblings().addClass("unsel")
          .parent().addClass("sel");
      }else{
        $(this).parent().removeClass("sel")
          .children().removeClass("unsel");
      }
    });
    $("#search_bar input[type=reset]").click(function(){
      $("#search_bar select").removeClass("sel")
        .children().removeClass("unsel");
    });
    //搜索条选择框筛选高亮显示
    
    // tag cloud
    
    $.getJSON("json_tagcloud.asp",function(data){
      function fColorRdm(){
        return Math.floor(Math.random()*220);
      }
      
      
      
      function fColor(){
        //return "#"+fColorRdm().toString(16)+fColorRdm().toString(16)+fColorRdm().toString(16);
        var str = "0123456789abcdef";
        var t = "#";
        for(var j=0;j<6;j++){
          t = t + str.charAt(Math.random()*str.length);
        }
        return t;
      }
    
      function fMinFreq(tags){
        var iMin,iMax;
        iMin=iMax=tags[0].freq;
        $.each(tags, function(i, item) {
          if(iMin>item.freq){
            iMin=item.freq;
          }
          if(iMax<item.freq){
            iMax=item.freq;
          }
        });
        return new Array(iMin,iMax);
      }
      
      iMinFreq=fMinFreq(data.tags)[0];
      iMaxFreq=fMinFreq(data.tags)[1];
      
      //create list for tag links
      $("<ul>").appendTo("#tags");
      //create tags
      $.each(data.tags, function(i, val) {
        
        //create item
        var li = $("<li>");

        //regex = new RegExp("有限公司");
        
        tag=val.tag;
        tag=tag.replace(/股份有限公司/g, "");
        tag=tag.replace(/集团有限公司/g, "");
        tag=tag.replace(/有限公司/g, "");
        tag=tag.replace(/宁波市/g, "");
        tag=tag.replace(/（宁波）/g, "");
        tag=tag.replace(/宁波/g, "");
        tag=tag.replace(/台州市/g, "");
        tag=tag.replace(/台州/g, "");
        tag=tag.replace(/温州市/g, "");
        tag=tag.replace(/温州/g, "");
        tag=tag.replace(/鄞州区/g, "");
        tag=tag.replace(/鄞州/g, "");
        tag=tag.replace(/浙江省/g, "");
        tag=tag.replace(/浙江/g, "");
        
        
        //create link
        $("<a>").text(tag)
                .attr({title:"共 " + val.freq + " 单", href: val.tag })
                .css({"font-size": Math.log( val.freq ) / Math.log( iMinFreq ) + "em" , "color" : fColor()})
                .tooltip()
                .appendTo(li);
        
        
        
        
        //add to list
        li.appendTo("#tags>ul");
        //li.children().css("fontSize", (val.freq / 10 < 1) ? val.freq / 10 + 1 + "em" : val.freq / 10 + "em");
        //li.children().css({"font-size": Math.log( val.freq ) / Math.log( iMinFreq ) + "em","color":fColor()});
      });
    });
    
    $("#tags ul li a").live("click",function(e){
      e.preventDefault();
      //alert($(this).html());
      $("#tx_search").val($(this).attr("href"));
      $("#bt_search").trigger("click");
    });
    
    // tag cloud

  });
</script>	
<!--#include file="lib/js-google-analytics.asp"-->
</head>
<%
  if not CheckFlag(session("aaPostFlag"),1) then call JumpErrorPage(2)
%>
<body>
<div id="diaglog_print" title="打印查询结果">
  <form id="fm_print" name="fm_print">
    <div class="type-text">
      <label for="print_title">标题</label>
      <input id="print_title" name="print_title" type="text" />
    </div>
    <div class="type-select">
      <label for="search_col">选择打印列</label><br />
      <select id="search_col" name="search_col" multiple="multiple" size="11">
        <%
          for each x in d
        %>
        <option value="<%=x%>"><%=d(x)%></option>
        <%		
          next
        %>
      </select>
    </div>
  </form>
</div>
<!--#include file="lib/header.asp"-->
<!--#include file="lib/nav.asp"-->
<div id="main">

<!--#include file="lib/col1.asp"-->
<!--#include file="lib/col2.asp"-->
  <div id="col3" role="main">
    <div id="col3_content" class="clearfix">
      <form id="fm_search" name="fm_search">
        <table id="search_bar" class="full">
          <tr>
            <td id="lb_search"><label for="tx_search">查询内容：</label></td>
            <td>
              <div>
                <input id="tx_search" name="tx_search" type="text" />
                申报日期
                <input name="ksrq" id="ksrq" class="datepicker" type="text" size="10" maxlength="10" />-<input name="jsrq" id="jsrq" class="datepicker" type="text" size="10" maxlength="10" />
                <select id="cd_status" name="cd_status">
                  <option value="0">选择状况</option>
                  <option value="1">未退</option>
                  <option value="2">海关已退</option>
                  <option value="3">工厂已退</option>
                </select>
                已退日期
                <input name="ytksrq" id="ytksrq" class="datepicker" type="text" size="10" maxlength="10" disabled="disabled" />-<input name="ytjsrq" id="ytjsrq" class="datepicker" type="text" size="10" maxlength="10" disabled="disabled" />
                <select id="search_count" name="search_count">
                  <option value="100">最新100条</option>
                  <option value="0">全部</option>
                </select>
                <select id="show_rp" name="show_rp">
                  <option value="">显示收付</option>
                  <option value="true">只显示收</option>
                  <option value="false">只显示付</option>
                </select>
                <a id="show_adv" href="#">高级</a>
              </div>
              <div id="adv_search">
                <select id="wtr" name="wtr">
                  <option value="0">选择委托人</option>
                  <%
                    Set rs_wtr = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM wtr order by id"
                    rs_wtr.Open sql,conn,1,1
                    do while not rs_wtr.eof
                  %>
                  <option value="<%=rs_wtr("id")%>" <%if rs_wtr("id")=clng(wtr) then response.write("selected='selected'")%>><%=rs_wtr("wtr")%></option>
                  <%
                      rs_wtr.movenext
                    loop
                    rs_wtr.close
                    set rs_wtr=nothing
                  %>
                </select>
                <select name="bwtr" id="bwtr">
                  <option value="0">选择被委托人</option>
                  <%
                    Set rs_bwtr = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM bwtr order by id"
                    rs_bwtr.Open sql,conn,1,1
                    do while not rs_bwtr.eof
                  %>
                  <option value="<%=rs_bwtr("id")%>" <%if rs_bwtr("id")=clng(bwtr) then response.write("selected='selected'")%>><%=rs_bwtr("bwtr")%></option>
                  <%
                      rs_bwtr.movenext
                    loop
                    rs_bwtr.close
                    set rs_bwtr=nothing
                  %>
                </select>
                <select name="category" id="category">
                  <option value="0">选择类型</option>
                  <%
                    Set rs_category = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM category order by id"
                    rs_category.Open sql,conn,1,1
                    do while not rs_category.eof
                  %>
                  <option value="<%=rs_category("id")%>" <%if rs_category("id")=clng(category) then response.write("selected='selected'")%>><%=rs_category("category")%></option>
                  <%
                      rs_category.movenext
                    loop
                    rs_category.close
                    set rs_category=nothing
                  %>
                </select>
                <select name="post" id="post">
                  <option value="0">选择岗位</option>
                  <%
                    for i=0 to ubound(session("aaPostFlag"),2)
                      if session("aaPostFlag")(0,i)<>0 and session("aaPostFlag")(0,i)<>5 then
                  %>
                  <option value="<%=session("aaPostFlag")(0,i)%>"><%=GetPostString(session("aaPostName"),session("aaPostFlag")(0,i))%></option>
                  <%
                      end if
                    next
                  %>
                </select>
                <select id="detail" name="detail">
                  <option value="0">选择详细费用</option>
                  <%
                    Set rs_detail = Server.CreateObject("ADODB.Recordset")
                    sql = "SELECT * FROM FEECATEGORY order by id"
                    rs_detail.Open sql,conn,1,1
                    do while not rs_detail.eof
                  %>
                  <option value="<%=rs_detail("id")%>">有<%=rs_detail("FEECATEGORY")%>费用</option>
                  <%
                      rs_detail.movenext
                    loop
                    rs_detail.close
                    set rs_detail=nothing
                  %>
                </select>
                <select id="passno" name="passno">
                  <option value="">是否有通关单</option>
                  <option value="true">有通关单</option>
                  <option value="false">无通关单</option>
                </select>
                <select id="orderno" name="orderno">
                  <option value="">是否有订单号</option>
                  <option value="true">有订单号</option>
                  <option value="false">无订单号</option>
                </select>
                <select id="boxno" name="boxno">
                  <option value="">是否有箱号</option>
                  <option value="true">有箱号</option>
                  <option value="false">无箱号</option>
                </select>
                <select id="fee" name="fee">
                  <option value="">是否有额外费用</option>
                  <option value="true">有额外费用</option>
                  <option value="false">无额外费用</option>
                </select>
                <select id="cd_received" name="cd_received">
                  <option value="">是否已收</option>
                  <option value="true">已收</option>
                  <option value="false">未收</option>
                </select>
                <select id="cd_paid" name="cd_paid">
                  <option value="">是否已付</option>
                  <option value="true">已付</option>
                  <option value="false">未付</option>
                </select>
                <select id="cd_confirm" name="cd_confirm">
                  <option value="">是否确认</option>
                  <option value="true">已确认</option>
                  <option value="false">未确认</option>
                </select>
              </div>
            </td>
            <td id="bts_search">
              <div class="ui-widget">
              <input id="bt_search" class="bt_button" name="bt_submit" type="button" value="搜索" />
              <input class="bt_button" type="reset" value="重置" />
              </div>
            </td>
          </tr>
        </table>
      </form>
      <div id="search_main">
        <div id="tags"></div>
      </div>
    </div>
  </div>
</div>
<!--#include file="lib/footer.asp"-->
</body>
</html>
<!--#include file="lib/connclose.asp"-->